<template>
  <maincontainer>
    <n-card title="公司详细信息" class="w-full h-full">
      <descriptions :infoList="_infoList"></descriptions>
    </n-card>
  </maincontainer>
</template>

<script setup name="Companyinfo" lang="ts">
import {useRoute, useRouter} from 'vue-router'
import {computed, DefineComponent, h, inject, ref} from "vue"

const router = useRouter()
const route = useRoute()
const resultData = ref<any>({})
const infoList = ref([
  {label: "公司名", key: "name", value: ""},
  {
    label: "公司规模", key: "name", value: "", render: (value: any) => {
      return "1000人"
    }
  },
  {
    label: "注册资金", key: "zijin", value: "", render: (value: number) => {
      return value / 10000 + "万元"
    }
  },
])
const _infoList = computed(()=>{
  return infoList.value.map(item=>{
    const value1 = resultData.value[item.key] || ""
    if(item.render){
      return {...item,value: item.render(value1)}
    }else{
      return {...item,value:value1 }
    }
  })
})
const zhucefunc:Function|undefined = inject("zhuceshuaxinfunc")
// 初始化函数
const init = () => {
}

// 初始化区域
init()
zhucefunc && zhucefunc({[route.name!.toString()]:init})
</script>


<style scoped>
</style>